package com.neusoft.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.neusoft.mapper.ReviewMapper;
import com.neusoft.po.Review;
import com.neusoft.service.ReviewService;

@Service
public class ReviewServiceImpl implements ReviewService{
	
	@Autowired
	private ReviewMapper reviewMapper;

	@Override
	public List<Review> listReviewByFoodId(Integer foodId) {
		// TODO Auto-generated method stub
		return reviewMapper.listReviewByFoodId(foodId);
	}

	@Override
	public List<Review> listReviewByUserId(String userId) {
		// TODO Auto-generated method stub
		return reviewMapper.listReviewByUserId(userId);
	}

	@Override
	@Transactional
	public int saveReview(Review review) {
		// TODO Auto-generated method stub
		return reviewMapper.saveReview(review);
	}

	@Override
	public int removeReview(Integer reviewId) {
		// TODO Auto-generated method stub
		return reviewMapper.removeReview(reviewId);
	}


}
